1bashThis demonstrates using PIPESTATUS to retrieve the exit status of commands in a pipeline for debugging or conditional logic.printf 'foo' | grep -F 'foo' | sed 's/foo/bar/' echo ${PIPESTATUS[0]} # replace 0 with Nbash internalprocess managementexit statuspipeline exit status (PIPESTATUS)